//
// Created by LiuYou on 2021/8/4.
//

//#ifndef LINUXENVIRONMENTPROGRAMMING_PROTO_HPP
//#define LINUXENVIRONMENTPROGRAMMING_PROTO_HPP
//
//#endif //LINUXENVIRONMENTPROGRAMMING_PROTO_HPP


#pragma once


#define KEY_PATH            "etc/services"
#define KEY_PROJ            'a'
#define PATH_MAX            1024
#define DATA_MAX            1024


namespace proto {
    enum {
        MSG_PATH = 1,
        MSG_DATA,
        MSG_EOT
    };


// 三种不同类型的包。
    class MsgPath {
    public:
        long mtype;
        char path[PATH_MAX];
    };


    class MsgData {
    public:
        long mtype;
        char data[DATA_MAX];
        int dataLen;
    };


    class MsgEOT {
    public:
        long mtype;
    };


    union MsgS2C {
        long mtype;
        MsgData msgData;
        MsgEOT msgEot;
    };
}